---
title: How to create a short link on Dub?
updatedAt: 2023-07-26
summary: Learn how to create your first short link on Dub and start tracking your links.
author: steventey
categories:
  - link-management
  - getting-started
related:
  - how-to-use-tags
  - what-is-a-project
  - how-to-add-custom-domain
---

Our link builder comes with powerful features like UTM builder, device targeting, password protection, expiration dates, and more.

Dub is also the only link management tool that lets you customize the social media cards for your links, so you can have full control over how your links look when shared on social media.

In this article, we will take a look at how you can leverage these features to create your first short link on Dub.

## Dub.sh links vs custom domain links

When you sign up for Dub, you have the option to choose between the default `dub.sh` domain or your own custom domain to create short links.

<Image
  alt="Onboarding screen where you can choose between Dub.sh links or custom domain links"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/onboarding-interim.png"
  width={1103}
  height={677}
/>

Here are the difference between the two options:

|                        | Default `dub.sh` links                                            | Custom domain links                                                                                                                                                                       |
| ---------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Setup ease**         | No setup required – you can start creating short links right away | You will need to [create a project](what-is-a-project#how-to-create-a-project) and [set up your custom domain](how-to-add-custom-domain) first before you can start creating short links. |
| **Branding**           | Dub branding on the short link                                    | Your own branding on the short link                                                                                                                                                       |
| **Dashboard location** | [app.dub.co/links](https://app.dub.co/links)                      | Can be found in the project select menu at the top menu bar                                                                                                                               |
| **Link history**       | 30 days                                                           | 30 days - Unlimited ([Pro plan](pro-plan))                                                                                                                                                |
| **Tags**               | Unavailable                                                       | Can be used to organize links                                                                                                                                                             |
| **Link cloaking**      | Unavailable                                                       | Can be used to mask destination URL with your short link                                                                                                                                  |
| **Geo Targeting**      | Unavailable                                                       | Available on the [Pro plan](pro-plan)                                                                                                                                                     |

## The Dub link builder

There are 3 ways to open the Dub link builder to create a short link:

1. **Slowest**: Click on the "Create link" button on the dashboard.
2. **Faster**: Use the keyboard shortcut `c` to open the link builder.
3. **Fastest**: Just paste in a valid URL into the dashboard. This will automatically open the link builder and pre-fill the URL field.

<Image
  alt="The Dub link builder"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/dub-link-builder.png"
  width={1353}
  height={1004}
/>

Inside the link builder are the following fields:

1. **Destination URL**: The URL that you want to shorten.
2. **Short link**: The short link that will be generated for you. You can generate a random slug by clicking the "Randomize" button or by typing in your own.
3. **Choose a tag** (custom domain links only): Choose a tag to organize your links. You can learn more about tags [here](how-to-use-tags).
4. **Custom Social Media Cards**: Customize how your links look when shared on social media. [Learn more](#custom-social-media-cards).
5. **UTM Builder**: Add UTM parameters to your links. [Learn more](#utm-builder).
6. **Link Cloaking**: Mask your destination URL with your short link. [Learn more](#link-cloaking).
7. **Password Protection**: Protect your links with a password. [Learn more](#password-protection).
8. **Expiration Date**: Set an expiration date for your links. [Learn more](#expiration-date).
9. **Device Targeting**: Set a custom destination URL for iOS and Android devices. [Learn more](#device-targeting-ios--android).
10. **Geo Targeting** (Pro plan only): Redirect your users to different links based on their location. [Learn more](#geo-targeting).
11. **Social Previews**: See how your links will look when shared on social media.
12. **Comments**: Add comments to your links – for you and your team. [Learn more](#comments).

## Custom social media cards

Dub is the only link management tool that lets you customize the social media cards for your links, so you can have full control over how your links look when shared on social media.

To leverage this feature, toggle the "Custom Social Media Cards" switch in the link builder. This will reveal the following fields:

1. **Image**: The image that will be used for the social media card. You can upload an image from your computer or drag and drop an image into the field (recommended size: 1200 x 630 pixels, max 1.5MB).
2. **Title**: The title that will be used for the social media card (max 120 characters).
3. **Description**: The description that will be used for the social media card (max 240 characters).

<Image
  alt="Create custom social media cards for your links"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/custom-social-media-cards.png"
  width={1149}
  height={779}
/>

Here's a demo of how this feature works:

<Tweet id="1575526002570182661" />

## UTM builder

You can use the UTM builder to populate UTM parameters for your links.

- **Referral** (`ref`): The website that is sending traffic to your link.
- **UTM Source** (`utm_source`): The source of your traffic (e.g. Facebook, Twitter, etc.).
- **UTM Medium** (`utm_medium`): The medium of your traffic (e.g. social, email, etc.).
- **UTM Campaign** (`utm_campaign`): The name of your campaign (e.g. summer2023)
- **UTM Term** (`utm_term`): The term of your campaign (e.g. running+shoes)
- **UTM Content** (`utm_content`): The content of your campaign (e.g. logo+link)

<Image
  alt="Use the UTM builder to populate UTM parameters for your links"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/utm-builder.png"
  width={836}
  height={583}
/>

## Link cloaking

You can mask your destination URL with your short link by toggling the "Link Cloaking" switch in the link builder.

<Image
  alt="Toggling the 'Link Cloaking' switch in the link builder"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/link-cloaking.png"
  width={1126}
  height={478}
/>

When this is enabled, your short link will be shown in your users' browser address bar when they visit your link instead of the destination URL.

<Image
  alt="Masking 'slack.com' with 'dub.sh/slack'"
  src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/link-cloaking.png"
  width={811}
  height={525}
/>

<Note variant="success">
  This feature is only available for short links created with a [custom
  domain](how-to-add-custom-domain).
</Note>

A few caveats for the URL masking feature:

1. This feature is only available for [Pro plans and above](pro-plan).
2. URL masking might not work for certain websites that have security measures in place to prevent this (e.g. `twitter.com`).

## Password protection

You can protect your links with a password by toggling the "Password Protection" switch in the link builder.

<Image
  alt="With Dub, you can protect your links with a password"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/password-section.png"
  width={693}
  height={221}
/>

Then, when you share your link, the user will be prompted to enter a password before they can access the destination URL.

<Image
  alt="An example of a password protected page"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/password-protected-page.png"
  width={1421}
  height={940}
/>

Here's a demo: [dub.sh/password](https://dub.sh/password) (password is `dub`)

## Expiration date

You can set an expiration date for your links by toggling the "Expiration Date" switch in the link builder.

<Image
  alt="Setting an expiration date for your Dub links"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/expiration-date.png"
  width={604}
  height={390}
/>

If you set an expiration date for your link, the user will be redirected to a 404 page when they try to access the link after the expiration date.

## Device targeting (iOS / Android)

Device targeting is a powerful feature that lets you personalize the destination URL for your links based on the user's device type.

For example, you can set a custom destination URL for iOS devices by toggling the "iOS Targeting" switch in the link builder, and a different URL for Android devices by toggling the "Android Targeting" switch in the link builder.

<Image
  alt="Use device targeting to personalize your link's behavior based on the user's device type"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/device-targeting.png"
  width={810}
  height={366}
/>

This is particularly useful if you want to send iOS users to the App Store to download your iOS app, and Android users to the Google Play Store to download your Android app.

In both cases, the main **Destination URL** will be used as the fallback URL that will be used if the user's device type does not match the targeting rules.

<Note variant="warning">
  Device targeting currently is not supported for password-protected pages. If
  you enable device targeting for a password-protected page, the user will be
  redirected to the default destination URL regardless of their device type.
</Note>

## Geo Targeting

<Note variant="success">
  This feature is only available for [Pro plans and above](pro-plan).
</Note>

Geo Targeting is a powerful feature that lets you redirect your users to different links based on their location.

This is useful if you want to do location-based personalization. For example, you can redirect your UK users to a UK-specific landing page, with the rest of the world going to your global landing page.

To use this feature, toggle the "Geo Targeting" switch in the link builder. This will reveal the following fields:

1. **Country**: The country that you want to target.
2. **URL**: The URL that you want to redirect your users to if they are from the country that you have selected.

<Image
  alt="Use Geo Targeting to redirect your users to different links based on their location"
  src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/geo-targeting.png"
  width={1404}
  height={902}
/>

You can also add multiple geo-targeting rules by clicking on the "Add location" button.

<Note variant="warning">
  Geo targeting currently is not supported for password-protected pages. If you
  enable geo targeting for a password-protected page, the user will be
  redirected to the default destination URL regardless of their location.
</Note>

## Link Comments

You can add comments to your links by toggling the "Comments" switch in the link builder.

<Image
  alt="Adding comments to your links in the Dub link builder"
  src="https://d2vwwcvoksz7ty.cloudfront.net/help/comments-section.png"
  width={1370}
  height={950}
/>

When you add a comment to your link, it will be visible to you and your team as a message bubble on the link card.

<Image
  alt="Comments are visible as message bubbles on the link card"
  src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/link-comments.png"
  width={1607}
  height={945}
/>
